import request from '@/utils/request'

// 获取权限列表
export function getRightListApi(data) {
  return request({
    url: 'rights',
    method: 'get',
    params: data
  })
}

// 删除一级权限
export function delRightApi(ids) {
  return request({
    url: `rights/${ids}`,
    method: 'delete'
  })
}

// 删除二级权限
export function delRightChildrenApi(ids) {
  return request({
    url: `children/${ids}`,
    method: 'delete'
  })
}

// 修改一级权限
export function updateRightApi(id, data) {
  return request({
    url: `rights/${id}`,
    method: 'put',
    data
  })
}

// 修改二级权限
export function updateRightChildrenApi(id, data) {
  return request({
    url: `children/${id}`,
    method: 'put',
    data
  })
}